﻿Public Class frmBox




    Private Sub frmBox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ToolStripStatusLabel1.Text = ""
    End Sub

    Public Sub Append(ByVal argText As String)
        Dim xStr As String = WebBrowser1.DocumentText
        If Trim(xStr) = "" Then xStr = "<font size=2 face=tahoma>"
        xStr = xStr & argText
        WebBrowser1.DocumentText = xStr
    End Sub

    Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Close()
    End Sub


    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

    End Sub



    Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
        Dim ffx As String = "C:\Program Files\Mozilla Firefox\firefox.exe"
        If IO.File.Exists(ffx) Then
            Dim link As HtmlElement = WebBrowser1.Document.ActiveElement
            Dim url As String = link.GetAttribute("href")
            Process.Start(ffx, url)
            e.Cancel = True
        End If
    End Sub



    Private Sub WebBrowser1_StatusTextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.StatusTextChanged
        mdiMain.ToolStripStatusLabel.Text = WebBrowser1.StatusText
    End Sub
End Class